package com.prft.rms.entity;

// Generated Aug 18, 2009 4:13:41 PM by Hibernate Tools 3.2.1.GA

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * AssignmentHis generated by hbm2java
 */
@Entity
@Table(name = "ASSIGNMENT_HIS", catalog = "RMS")
public class AssignmentHis implements java.io.Serializable {

	private Integer assignmentId;
	private Employee employee;
	private Project projectByProjectId;
	private Project projectByTargetProjectId;
	private Date startDate;
	private Date thruDate;
	private Date lastUpdated;
	private String remarks;
	private Set<BillableHis> billableHises = new HashSet<BillableHis>(0);

	public AssignmentHis() {
	}

	public AssignmentHis(Employee employee, Project projectByProjectId, Project projectByTargetProjectId,
			Date lastUpdated) {
		this.employee = employee;
		this.projectByProjectId = projectByProjectId;
		this.projectByTargetProjectId = projectByTargetProjectId;
		this.lastUpdated = lastUpdated;
	}

	public AssignmentHis(Employee employee, Project projectByProjectId, Project projectByTargetProjectId,
			Date startDate, Date thruDate, Date lastUpdated, String remarks, Set<BillableHis> billableHises) {
		this.employee = employee;
		this.projectByProjectId = projectByProjectId;
		this.projectByTargetProjectId = projectByTargetProjectId;
		this.startDate = startDate;
		this.thruDate = thruDate;
		this.lastUpdated = lastUpdated;
		this.remarks = remarks;
		this.billableHises = billableHises;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ASSIGNMENT_ID", unique = true, nullable = false)
	public Integer getAssignmentId() {
		return this.assignmentId;
	}

	public void setAssignmentId(Integer assignmentId) {
		this.assignmentId = assignmentId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "EMID", nullable = false)
	public Employee getEmployee() {
		return this.employee;
	}

	public void setEmployee(Employee employee) {
		this.employee = employee;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PROJECT_ID", nullable = false)
	public Project getProjectByProjectId() {
		return this.projectByProjectId;
	}

	public void setProjectByProjectId(Project projectByProjectId) {
		this.projectByProjectId = projectByProjectId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TARGET_PROJECT_ID", nullable = false)
	public Project getProjectByTargetProjectId() {
		return this.projectByTargetProjectId;
	}

	public void setProjectByTargetProjectId(Project projectByTargetProjectId) {
		this.projectByTargetProjectId = projectByTargetProjectId;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "START_DATE", length = 10)
	public Date getStartDate() {
		return this.startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "THRU_DATE", length = 10)
	public Date getThruDate() {
		return this.thruDate;
	}

	public void setThruDate(Date thruDate) {
		this.thruDate = thruDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "LAST_UPDATED", nullable = false, length = 19)
	public Date getLastUpdated() {
		return this.lastUpdated;
	}

	public void setLastUpdated(Date lastUpdated) {
		this.lastUpdated = lastUpdated;
	}

	@Column(name = "REMARKS")
	public String getRemarks() {
		return this.remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "assignmentHis")
	public Set<BillableHis> getBillableHises() {
		return this.billableHises;
	}

	public void setBillableHises(Set<BillableHis> billableHises) {
		this.billableHises = billableHises;
	}

}
